<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui"%>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys"%>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${tabTitle}</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
	<div class="Wrapper">
		<div>
			<div id="pageInTab" class="pageInTab">
				<form id="ins_cfg_info_edit_form">
					<div class="fieldset1 tabel_col clearFix">
						<!-- 自然人 -->
						<div id="cstNp" style="display: none;">
							<div class="fieldBox col_50">
								<div class="label">所属行业</div>
								<div class="field">
									<select name="indCd" id="indCd" value="${indCd}" validate="{required:true}">
										<c:if test="${indCd == null || indCd == ''}">
											<option value="" selected="selected">--请选择--</option>
										</c:if>
										<c:if test="${indCd != null && indCd != ''}">
											<option value="">--请选择--</option>
										</c:if>
										<c:forEach items="${indCdInfoList}" var="item">
											<c:if test="${item.key == indCd}">
												<option value="${item.key}" selected="selected">${item.value}</option>
											</c:if>
											<c:if test="${item.key != indCd}">
												<option value="${item.key}">${item.value}</option>
											</c:if>
										</c:forEach>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">客户姓名</div>
								<div class="field">
									<span >${cstNm}</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">身份证号码</div>
								<div class="field">
									<span >${certNo}</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">预留手机号</div>
								<div class="field">
									<input name="mp" id="mp" type="text" class="ui-textbox" value="${mp}" validate="{number:true, maxlength:11, minlength:11}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">开户银行</div>
								<div class="field">
									<select name="bkCd" id="bkCd" value="${bkCd}" validate="{required:true}">
										<c:if test="${bkCd == null || bkCd == ''}">
											<option value="" selected="selected">--请选择--</option>
										</c:if>
										<c:if test="${bkCd != null && bkCd != ''}">
											<option value="">--请选择--</option>
										</c:if>
										<c:forEach items="${bankList}" var="item">
											<c:if test="${item.key == bkCd}">
												<option value="${item.key}" selected="selected">${item.value}</option>
											</c:if>
											<c:if test="${item.key != bkCd}">
												<option value="${item.key}">${item.value}</option>
											</c:if>
										</c:forEach>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">银行卡号</div>
								<div class="field">
									<input name="accNo" id="accNo" type="text" class="ui-textbox" value="${accNo}" validate="{number:true, maxlength:22, minlength:15}">
									<span class="requiredSymbol">*</span>
									<span class="requiredSymbol">单笔限额：<span class="requiredSymbol" id="singleQuota">${singleQuota}</span></span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">子行业</div>
								<div class="field">
									<input name="stdIndCd" id="stdIndCd" data-value=" " placeholder="--请选择--" ltype="combobox">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">证件类型</div>
								<div class="field">
									<c:if test="${certTypCd == null || certTypCd == '' || certTypCd != '0'}">
										<span>身份证</span>
									</c:if>
									<c:if test="${certTypCd != null && certTypCd == '0'}">
										<span>身份证</span>
									</c:if>
								</div>
							</div>
							<div class="fieldBox col_100_auto" >
								<div class="label">证件地址</div>
								<div class="field">
									<jsp:include page="../../system/sysRegion/region.jsp" flush="true">
										<jsp:param name="regionShowLvl"  value="3"/>
									</jsp:include>
									<input name="idAddr" id="idAddr" type="text" class="ui-textbox" value="${idAddr}" validate="{required:true}" placeholder="详细地址" style="width: 400px;">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">是否个体工商户</div>
								<div class="field">
									<select name="isSelfEmp" id="isSelfEmp" data-value="" validate="{required:true, select: true}" ligerui="{width: 100}">
										<option value=" " ${(isSelfEmp == null || isSelfEmp == '') ? "selected='selected'" : ""}>--请选择--</option>
										<option value="0" ${(isSelfEmp != null && isSelfEmp == '0') ? "selected='selected'" : ""}>否</option>
										<option value="1" ${(isSelfEmp != null && isSelfEmp == '1') ? "selected='selected'" : ""}>是</option>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">是否小微企业</div>
								<div class="field">
									<select name="isSmallBus" id="isSmallBus" data-value="" validate="{required:true, select: true}" ligerui="{width: 100}">
										<option value=" " ${(isSmallBus == null || isSmallBus == '') ? "selected='selected'" : ""}>--请选择--</option>
										<option value="0" ${(isSmallBus != null && isSmallBus == '0') ? "selected='selected'" : ""}>否</option>
										<option value="1" ${(isSmallBus != null && isSmallBus == '1') ? "selected='selected'" : ""}>是</option>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">联行卡号</div>
								<div class="field">
									<input name="bkNo" id="bkNo" type="text" class="ui-textbox" value="${bkNo}" validate="{number:true}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">证件有效起始日期</div>
								<div class="field">
									<input name="certValidSDt" id="certValidSDt" type="text" class="ui-datepicker" value="${certValidSDt}" validate="{required:true}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50 col_fix_photo">
								<div class="label">证件有效终止日期</div>
								<div class="field">
									<input name="certValidEDt" id="certValidEDt" type="text" class="ui-datepicker" value="${certValidEDt}" >
									<div><input type="checkbox" name="checkOne" id="checkOne"  <c:if test="${certValidEDt=='长期'}">checked</c:if> value="长期" onchange="enduring(this)">长期</div>
									<span class="requiredSymbol">*</span>
								</div>
							</div>

						</div>
						<!-- 法人 -->
						<div id="cstCorp" style="display: none;">
							<div class="fieldBox col_50">
								<div class="label">法人代表姓名</div>
								<div class="field">
									<input name="cstNmCorp" id="cstNmCorp" type="text" class="ui-textbox" value="${cstNm}" />
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">借款人特征</div>
								<div class="field">
									<select name="borrowerfeature" id="borrowerfeature" value="${borrowerfeature}" validate="{required:true}">
										<c:if test="${borrowerfeature == null || borrowerfeature == ''}">
											<option value=" " selected="selected">--请选择--</option>
										</c:if>
										<c:if test="${borrowerfeature != null && borrowerfeature != ''}">
											<option value=" ">--请选择--</option>
										</c:if>
										<c:forEach items="${borrowerfeatureList}" var="item">
											<c:if test="${item.key == borrowerfeature}">
												<option value="${item.key}" selected="selected">${item.value}</option>
											</c:if>
											<c:if test="${item.key != borrowerfeature}">
												<option value="${item.key}">${item.value}</option>
											</c:if>
										</c:forEach>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">所属行业</div>
								<div class="field">
									<select name="indCdCorp" id="indCdCorp" value="${indCd}" validate="{required:true}">
										<c:if test="${indCd == null || indCd == ''}">
											<option value="" selected="selected">--请选择--</option>
										</c:if>
										<c:if test="${indCd != null && indCd != ''}">
											<option value="">--请选择--</option>
										</c:if>
										<c:forEach items="${indCdInfoList}" var="item">
											<c:if test="${item.key == indCd}">
												<option value="${item.key}" selected="selected">${item.value}</option>
											</c:if>
											<c:if test="${item.key != indCd}">
												<option value="${item.key}">${item.value}</option>
											</c:if>
										</c:forEach>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>

							<div class="fieldBox col_50">
								<div class="label">法人代表身份证号</div>
								<div class="field">
									<input name="certNoCorp" id="certNoCorp" type="text" class="ui-textbox" value="${certNo}" validate="{number:true}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">法人代表手机号</div>
								<div class="field">
									<input name="mpCorp" id="mpCorp" type="text" class="ui-textbox" value="${mp}" validate="{number:true, maxlength:11, minlength:11}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">子行业</div>
								<div class="field">
									<input name="stdIndCdCorp" id="stdIndCdCorp" data-value=" " placeholder="--请选择--" ltype="combobox">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">控股情况</div>
								<div class="field">
									<select name="holdSituationCd" id="holdSituationCd" value="${holdSituationCd}" validate="{required:true}">
										<c:if test="${holdSituationCd == null || holdSituationCd == ''}">
											<option value=" " selected="selected">--请选择--</option>
										</c:if>
										<c:if test="${holdSituationCd != null && holdSituationCd != ''}">
											<option value=" ">--请选择--</option>
										</c:if>
										<c:forEach items="${holdSituationCdList}" var="item">
											<c:if test="${item.key == holdSituationCd}">
												<option value="${item.key}" selected="selected">${item.value}</option>
											</c:if>
											<c:if test="${item.key != holdSituationCd}">
												<option value="${item.key}">${item.value}</option>
											</c:if>
										</c:forEach>
									</select>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">证件有效起始日期</div>
								<div class="field">
									<input name="certValidSDtCorp" id="certValidSDtCorp" type="text" class="ui-datepicker" value="${certValidSDt}" validate="{required:true}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50 col_fix_photo">
								<div class="label">证件有效终止日期</div>
								<div class="field">
									<input name="certValidEDtCorp" id="certValidEDtCorp" type="text" class="ui-datepicker" value="${certValidEDt}" >
									<div><input type="checkbox" name="checkOneCorp" id="checkOneCorp"  <c:if test="${certValidEDt=='长期'}">checked</c:if> value="长期" onchange="enduring(this)">长期</div>
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_1_100" >
								<div class="label">法人联系地址</div>
								<div class="field">
									<jsp:include page="../../system/sysRegion/regionSecUse.jsp" flush="true">
										<jsp:param name="regionShowSecUseLvl"  value="3"/>
									</jsp:include>
									<input name="idAddrCorp" id="idAddrCorp" type="text" class="ui-textbox" value="${idAddr}" validate="{required:true}" placeholder="详细地址" >
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">公司公户还款账号</div>
								<div class="field">
									<input name="accNoCorp" id="accNoCorp" type="text" class="ui-textbox" value="${accNo}" validate="{number:true, maxlength:22, minlength:15}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">公司名称</div>
								<div class="field">
									<span>${shtNm}</span>
								</div>
							</div>
							<div class="fieldBox col_50">
								<div class="label">联行号</div>
								<div class="field">
									<input name="bkNoCorp" id="bkNoCorp" type="text" class="ui-textbox" value="${bkNo}" validate="{number:true}">
									<span class="requiredSymbol">*</span>
								</div>
							</div>

						</div>
						<!-- hide data -->
						<div class="fieldBox col_100" style="display: none;">
							<div class="field">
								<input name="prjId" id="prjId" type="text" class="ui-textbox" value="${prjId}">
								<input name="cstId" id="cstId" type="text" class="ui-textbox" value="${cstId}">
								<input name="cstNm" id="cstNm" type="text" class="ui-textbox" value="${cstNm}">
								<input name="certNo" id="certNo" type="text" class="ui-textbox" value="${certNo}">
								<input name="cstAccInfoId" id="cstAccInfoId" type="text" class="ui-textbox" value="${cstAccInfoId}">
								<input name="fundRasInsId" id="fundRasInsId" type="text" class="ui-textbox" value="${fundRasInsId}">
								<input name="fundRasInsNm" id="fundRasInsNm" type="text" class="ui-textbox" value="${fundRasInsNm}">
								<input name="cstTypCd" id="cstTypCd" type="text" class="ui-textbox" value="${cstTypCd}">
							</div>
						</div>
					</div>
	                <div id="saveInsCfgDiv" class="btnsBox">
						<span id="saveInsCfg" class="sq-button sq-button-round" onclick="return saveInfo();">保存</span>
                	</div>
                    <div class="fieldset1 tabel_col clearFix" id="forNp">
                        <div class="fieldBox col_50" id="tlBind">
                            <div class="label">通联支付支付绑卡</div>
                            <div class="field">
                                <input name="tlCode" id="tlCode" type="text" class="ui-textbox" value="">
                                <span class="requiredSymbol">*</span>
								<div id="tlBtnDiv">
									<c:if test="${accResCd == '0003' || accResCd == '0009'}">
										<span id="tlMsmCodeCfg" class="sq-button sq-button-round" onclick="return tlCode();">获取验证码</span>
										<span id="tlMsmCodeCfg" class="sq-button sq-button-round" onclick="return tlBind();">提交验证</span>
									</c:if>
									<c:if test="${accResCd == '0006' || accResCd == '0000'}">
										已绑卡
									</c:if>
								</div>
                            </div>
                        </div>
						<div class="fieldBox col_50" id="npBind">
							<div class="label">资方订单绑卡</div>
							<div class="field">
								<input name="npCode" id="npCode" type="text" class="ui-textbox" value="">
								<span class="requiredSymbol">*</span>
								<div id="npBtnDiv">
									<c:if test="${accResCd == '0003' || accResCd == '0006'}">
										<span id="npMsmCodeCfg" class="sq-button sq-button-round" onclick="return npCode();">获取验证码</span>
										<span id="npMsmCodeCfg" class="sq-button sq-button-round" onclick="return npBind();">提交验证</span>
									</c:if>
									<c:if test="${accResCd == '0009' || accResCd == '0000'}">
										已绑卡
									</c:if>
								</div>
							</div>
						</div>
                    </div>
					<div class="fieldset1 tabel_col clearFix" id="forCorp">
						<div class="fieldBox col_50">
							<div class="label">资方订单绑卡</div>
							<div class="field">
								<input name="payBackCode" id="payBackCode" type="text" class="ui-textbox" value="">
								<span class="requiredSymbol">*</span>
								<div id="payBackBtnDiv">
									<c:if test="${accResCd == '0003'}">
										<span id="payBackMsmCodeCfg" class="sq-button sq-button-round" onclick="return payBackCode();">获取验证码</span>
										<span id="payBackMsmCodeCfg" class="sq-button sq-button-round" onclick="return payBackBind();">提交验证</span>
									</c:if>
									<c:if test="${accResCd == '0000'}">
										已绑卡
									</c:if>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>

<script type="text/javascript">

var isCstBind = '${isCstBind}';
var detailFlag = '${detailFlag}';
var singleQuotaMap = '${singleQuotaMap}';
var cstTypCd = '${cstTypCd}';
var certValidEDt;
var certValidEDtCorp;
var indCd = '${indCd}';
var stdIndCd = '${stdIndCd}';
var accResCd = '${accResCd}';

var mp = '${mp}';
var bkCd = '${bkCd}';
var accNo = '${accNo}';

function resetAccResCd(accResCd){
	if (null != cstTypCd && "1" == cstTypCd) {
		if (accResCd=="0000") {
			$("#tlCode").val("");
			$("#npCode").val("");
			$("#tlBtnDiv").html("已绑卡");
			$("#npBtnDiv").html("已绑卡");
		} else if (accResCd=="0003") {
			var html = '<span id="tlMsmCodeCfg" class="sq-button sq-button-round" onclick="return tlCode();">获取验证码</span>'
					+ '<span id="tlMsmCodeCfg" class="sq-button sq-button-round" onclick="return tlBind();">提交验证</span>';
			$("#tlBtnDiv").html(html);
			var htmlNp = '<span id="npMsmCodeCfg" class="sq-button sq-button-round" onclick="return npCode();">获取验证码</span>'
					+ '<span id="npMsmCodeCfg" class="sq-button sq-button-round" onclick="return npBind();">提交验证</span>';
			$("#npBtnDiv").html(htmlNp);
		} else if (accResCd=="0006") {
			$("#tlCode").val("");
			$("#tlBtnDiv").html("已绑卡");
			var htmlNp = '<span id="npMsmCodeCfg" class="sq-button sq-button-round" onclick="return npCode();">获取验证码</span>'
					+ '<span id="npMsmCodeCfg" class="sq-button sq-button-round" onclick="return npBind();">提交验证</span>';
			$("#npBtnDiv").html(htmlNp);
		} else if (accResCd=="0009") {
			$("#npCode").val("");
			$("#npBtnDiv").html("已绑卡");
			var html = '<span id="tlMsmCodeCfg" class="sq-button sq-button-round" onclick="return tlCode();">获取验证码</span>'
					+ '<span id="tlMsmCodeCfg" class="sq-button sq-button-round" onclick="return tlBind();">提交验证</span>';
			$("#tlBtnDiv").html(html);
		}
	}
	if (null != cstTypCd && "2" == cstTypCd) {
		if (accResCd=="0000" && "true" == isCstBind) {
			$("#packBackBtnDiv").html("已绑卡");
		} else if (accResCd=="0003" && "true" == isCstBind) {
			var html = '<span id="packBackMsmCodeCfg" class="sq-button sq-button-round" onclick="return payBackCode();">获取验证码</span>'
					+ '<span id="packBackMsmCodeCfg" class="sq-button sq-button-round" onclick="return payBackBind();">提交验证</span>';
			$("#packBackBtnDiv").html(html);
		}
	}
}

$(function () {
	initData();
	enduring();

});

function initData() {
    $("#ins_cfg_info_edit_form").ligerForm({
		validate: true
	});

    if (null != cstTypCd && "1" == cstTypCd) {
    	// 自然人
		$("#cstNp").removeAttr("style");
		$("#npBind").hide();
	}
	if (null != cstTypCd && "2" == cstTypCd) {
		// 法人
		$("#cstCorp").removeAttr("style");
		$("#forNp").hide();
		// $("#tlCode").hide();
		// $("#tlBtnDiv").hide();
		// $("#tlMsmCodeCfg").hide();
		// $("#npCode").hide();
		// $("#npBtnDiv").hide();
		// $("#npMsmCodeCfg").hide();
	}

	$("#forCorp").hide();
	// $("#payBackCode").hide();
	// $("#payBackBtnDiv").hide();
	// $("#payBackMsmCodeCfg").hide();
	
	disabledInput();

	if (null != accResCd && ("0000" == accResCd || "0006" == accResCd || "0009" == accResCd)) {
		$("#saveInsCfg").hide();
	}

    if(singleQuotaMap!=""){
		singleQuotaMap = eval("("+singleQuotaMap+")");
	}
	$("#bkCd").change(function(){
		var bankNo = $("#bkCd").val();
		var singleQuota = singleQuotaMap[bankNo+""];
		$("#singleQuota").html(singleQuota ? singleQuota : "");
	});
	$("#stdIndCd").ligerComboBox({
		valueField: 'key',
		textField: 'value',
		width:150,
	});
	$("#stdIndCdCorp").ligerComboBox({
		valueField: 'key',
		textField: 'value',
		width:150,
	});
	$("#indCd").change(function(){
		var indCd = $("#indCd").val();
		initStdIndCdSelectData(indCd, cstTypCd, 1);
	});
	$("#indCdCorp").change(function(){
		var indCd = $("#indCdCorp").val();
		initStdIndCdSelectData(indCd, cstTypCd, 1);
	});


	if (StringUtils.isNotEmpty(indCd)) {
		initStdIndCdSelectData(indCd, cstTypCd, 0);
	}
	setRgnProvCdUpdataValue('${domicileProvince}');
	setRgnCityCdUpdataValue('${domicleCity}');
	setRgnCountyCdUpdataValue('${domicleCounty}');
	setRgnProvCdSecUseUpdataValue('${domicileProvince}');
	setRgnCityCdSecUseUpdataValue('${domicleCity}');
	setRgnCountyCdSecUseUpdataValue('${domicleCounty}');
}

function disabledInput() {
	if("true" == detailFlag || (null != accResCd && ("0000" == accResCd || "0006" == accResCd || "0009" == accResCd)) && "true" != isCstBind) {
		// 自然人
		liger.get("indCd").setDisabled();
		liger.get("mp").setDisabled();
		liger.get("bkCd").setDisabled();
		liger.get("accNo").setDisabled();
		liger.get("stdIndCd").setDisabled();
		liger.get("idAddr").setDisabled();
		liger.get("isSelfEmp").setDisabled();
		liger.get("isSmallBus").setDisabled();
		liger.get("bkNo").setDisabled();
		liger.get("certValidSDt").setDisabled();
		liger.get("certValidEDt").setDisabled();
		liger.get("tlCode").setDisabled();
		liger.get("npCode").setDisabled();

		// 法人
		liger.get("cstNmCorp").setDisabled();
		liger.get("borrowerfeature").setDisabled();
		liger.get("indCdCorp").setDisabled();
		liger.get("certNoCorp").setDisabled();
		liger.get("mpCorp").setDisabled();
		liger.get("stdIndCdCorp").setDisabled();
		liger.get("holdSituationCd").setDisabled();
		liger.get("certValidSDtCorp").setDisabled();
		liger.get("certValidEDtCorp").setDisabled();
		liger.get("idAddrCorp").setDisabled();
		liger.get("accNoCorp").setDisabled();
		liger.get("bkNoCorp").setDisabled();

		liger.get("rgnProvCd").setDisabled();
		liger.get("rgnCityCd").setDisabled();
		liger.get("rgnCountyCd").setDisabled();
		liger.get("rgnProvCdSecUse").setDisabled();
		liger.get("rgnCityCdSecUse").setDisabled();
		liger.get("rgnCountyCdSecUse").setDisabled();

		// $("#saveInsCfgDiv").hide();
		$("#saveInsCfg").hide();
		// $("#tlBtnDiv").hide();
		// $("#tlMsmCodeCfg").hide();
		$("#npBtnDiv").hide();
		// $("#npMsmCodeCfg").hide();
		if (null != accResCd && ("0000" == accResCd || "0006" == accResCd || "0009" == accResCd)) {
			$("#tlBtnDiv").html("已绑卡");
		} else {
			$("#tlBtnDiv").html("未绑卡");
		}

		liger.get("payBackCode").setDisabled();
		$("#forCorp").hide();
		// $("#payBackBtnDiv").hide();
		// $("#payBackMsmCodeCfg").hide();
		// $("#payBackCode").hide();

	}
	if (null != isCstBind && "true" == isCstBind) {
		// 自然人
		liger.get("indCd").setDisabled();
		liger.get("mp").setDisabled();
		liger.get("bkCd").setDisabled();
		liger.get("accNo").setDisabled();
		liger.get("stdIndCd").setDisabled();
		liger.get("idAddr").setDisabled();
		liger.get("isSelfEmp").setDisabled();
		liger.get("isSmallBus").setDisabled();
		liger.get("bkNo").setDisabled();
		liger.get("certValidSDt").setDisabled();
		liger.get("certValidEDt").setDisabled();
		liger.get("tlCode").setDisabled();
		// liger.get("npCode").setDisabled();

		// 法人
		liger.get("cstNmCorp").setDisabled();
		liger.get("borrowerfeature").setDisabled();
		liger.get("indCdCorp").setDisabled();
		liger.get("certNoCorp").setDisabled();
		liger.get("mpCorp").setDisabled();
		liger.get("stdIndCdCorp").setDisabled();
		liger.get("holdSituationCd").setDisabled();
		liger.get("certValidSDtCorp").setDisabled();
		liger.get("certValidEDtCorp").setDisabled();
		liger.get("idAddrCorp").setDisabled();
		liger.get("accNoCorp").setDisabled();
		liger.get("bkNoCorp").setDisabled();

		liger.get("rgnProvCd").setDisabled();
		liger.get("rgnCityCd").setDisabled();
		liger.get("rgnCountyCd").setDisabled();
		liger.get("rgnProvCdSecUse").setDisabled();
		liger.get("rgnCityCdSecUse").setDisabled();
		liger.get("rgnCountyCdSecUse").setDisabled();

		// $("#saveInsCfgDiv").hide();
		$("#saveInsCfg").hide();
		// $("#tlMsmCodeCfg").hide();
		// $("#tlCode").hide();
		// $("#tlBtnDiv").hide();
		// $("#npCode").hide();
		// $("#npBtnDiv").hide();
		// $("#npMsmCodeCfg").hide();
		// $("#forNp").hide();
		if (null != cstTypCd && "1" == cstTypCd) {
			// 自然人
			$("#forCorp").hide();
			$("#forNp").show();
			$("#npBind").show();
			liger.get("tlCode").setDisabled();
			liger.get("npCode").setEnabled();

			if (null != accResCd && ("0000" == accResCd || "0006" == accResCd || "0009" == accResCd)) {
				$("#tlBtnDiv").html("已绑卡");
			} else {
				$("#tlBtnDiv").html("未绑卡");
			}
		}
		if (null != cstTypCd && "2" == cstTypCd) {
			// 法人
			$("#forNp").hide();
			$("#forCorp").show();
		}
	}
}

function disabledInput2(type) {
	// 自然人
	liger.get("indCd").setDisabled();
	liger.get("mp").setDisabled();
	liger.get("bkCd").setDisabled();
	liger.get("accNo").setDisabled();
	liger.get("stdIndCd").setDisabled();
	liger.get("idAddr").setDisabled();
	liger.get("isSelfEmp").setDisabled();
	liger.get("isSmallBus").setDisabled();
	liger.get("bkNo").setDisabled();
	liger.get("certValidSDt").setDisabled();
	liger.get("certValidEDt").setDisabled();

	// 法人
	liger.get("cstNmCorp").setDisabled();
	liger.get("borrowerfeature").setDisabled();
	liger.get("indCdCorp").setDisabled();
	liger.get("certNoCorp").setDisabled();
	liger.get("mpCorp").setDisabled();
	liger.get("stdIndCdCorp").setDisabled();
	liger.get("holdSituationCd").setDisabled();
	liger.get("certValidSDtCorp").setDisabled();
	liger.get("certValidEDtCorp").setDisabled();
	liger.get("idAddrCorp").setDisabled();
	liger.get("accNoCorp").setDisabled();
	liger.get("bkNoCorp").setDisabled();

	liger.get("rgnProvCd").setDisabled();
	liger.get("rgnCityCd").setDisabled();
	liger.get("rgnCountyCd").setDisabled();
	liger.get("rgnProvCdSecUse").setDisabled();
	liger.get("rgnCityCdSecUse").setDisabled();
	liger.get("rgnCountyCdSecUse").setDisabled();

	liger.get("npCode").setDisabled();
	liger.get("payBackCode").setDisabled();

	// $("#saveInsCfgDiv").hide();
	$("#saveInsCfg").hide();


	if (null != cstTypCd && "1" == cstTypCd) {
		// 自然人
		$("#forCorp").hide();
		if ("1" == type) {
			liger.get("tlCode").setDisabled();
			$("#tlMsmCodeCfg").hide();
		}
		if ("2" == type) {
			liger.get("npCode").setDisabled();
			$("#npMsmCodeCfg").hide();
		}
	}
	if (null != cstTypCd && "2" == cstTypCd) {
		// 法人
		$("#forNp").hide();
		$("#payBackMsmCodeCfg").hide();
	}

}

function initStdIndCdSelectData(indCd, cstTypCd, type) {
	if(!indCd || !cstTypCd){
		return;
	}
	$.ajax({
		type: 'get',
		dataType:'json',
		data:{indCd:indCd},
		url: '<%=path%>/institution/syfl/getSyflStdIndList.do',
		success:function(msg){
			if(msg.success == 1){
				var stdIndCdList;
				if ("1" == cstTypCd) {
					stdIndCdList = liger.get("stdIndCd");
				}
				if ("2" == cstTypCd) {
					stdIndCdList = liger.get("stdIndCdCorp");
				}
				if(msg.data){
					stdIndCdList.clear();
					stdIndCdList.setData(msg.data);
					if (0 == type && null != stdIndCd && StringUtils.isNotEmpty(stdIndCd)) {
						stdIndCdList.selectValue(stdIndCd);
					}
				}else{
					stdIndCdList.clear();
					stdIndCdList.setData({});
				}
			}else{
				$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			}
		}
	});
}

/**
 * 获取通联验证码
 */
function tlCode(){
	if($("#tlMsmCodeCfg").attr("isSend") == '1'){
		return;
	}
	settime($("#tlMsmCodeCfg"), 180);
	var ligerForm = liger.get("ins_cfg_info_edit_form");

	var data = ligerForm.getData();

	data["bkCd"] = liger.get("bkCd").selectedValue;
	data["bkNm"] = liger.get("bkCd").selectedText;
	data["accNo"] =  $("#accNo").val();
	data["bkNo"] =  $("#bkNo").val();
	data["mp"] = $("#mp").val();
	data["certNo"] = $("#certNo").val();
	data["prjId"] = $("#prjId").val();
	data["cstId"] = $("#cstId").val();
	data["cstNm"] = $("#cstNm").val();
	data["cstTypCd"] = $("#cstTypCd").val();
	data["fundRasInsId"] = $("#fundRasInsId").val();
	var url = '<%=path%>/institution/syfl/sendVcodeSyfl.do';
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType: 'json',
		data: data,
		url: url,
		beforeSend: function () {
			wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
		},
		success: function (msg) {
			wait_dialog.close();
			if (msg.success == 1) {
				UIUtils.alertSuccessHold1(msg.info);
			} else {
				UIUtils.alertErrorHold1(msg.info);
			}
		}
	});
}

// 保存项目客户信息，后面弹出准入验证的资料确认页
function saveInfo() {
	var ligerForm = liger.get("ins_cfg_info_edit_form");
    // if (!ligerForm.valid()) {
    //     top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
    //     return false; //验证不通过，不执行以下代码
    // }
    var data = ligerForm.getData();

	if (null != cstTypCd && "1" == cstTypCd) {
		// 自然人
		if(!$("#indCd").val() || StringUtils.isEmpty($("#indCd").val())){
			top.$.ligerDialog.SQalert({content: "请选择所属行业！", SQ_type: "error"});
			return false;
		}
		if(!$("#stdIndCd").val() || StringUtils.isEmpty($("#stdIndCd").val())){
			top.$.ligerDialog.SQalert({content: "请选择子行业！", SQ_type: "error"});
			return false;
		}
		if(!$("#bkCd").val() || StringUtils.isEmpty($("#bkCd").val())){
			top.$.ligerDialog.SQalert({content: "请选择开户银行！", SQ_type: "error"});
			return false;
		}
		if(!$("#accNo").val() || StringUtils.isEmpty($("#accNo").val())){
			top.$.ligerDialog.SQalert({content: "请填写银行账号！", SQ_type: "error"});
			return false;
		}
		if(!$("#mp").val() || StringUtils.isEmpty($("#mp").val())){
			top.$.ligerDialog.SQalert({content: "请填写预留手机号码！", SQ_type: "error"});
			return false;
		}
		if(!$("#bkNo").val() || StringUtils.isEmpty($("#bkNo").val())){
			top.$.ligerDialog.SQalert({content: "请填写联行号！", SQ_type: "error"});
			return false;
		}
		if(!$("#isSelfEmp").val() || StringUtils.isEmpty($("#isSelfEmp").val())){
			top.$.ligerDialog.SQalert({content: "请选择是否个体工商户！", SQ_type: "error"});
			return false;
		}
		if(!$("#isSmallBus").val() || StringUtils.isEmpty($("#isSmallBus").val())){
			top.$.ligerDialog.SQalert({content: "请选择是否小微企业！", SQ_type: "error"});
			return false;
		}
		if(!getRgnProvCd() || StringUtils.isEmpty(getRgnProvCd())){
			top.$.ligerDialog.SQalert({content: "请维护所在-省！", SQ_type: "error"});
			return false;
		}
		if(!getRgnCityCd() || StringUtils.isEmpty(getRgnCityCd())){
			top.$.ligerDialog.SQalert({content: "请维护所在-市！", SQ_type: "error"});
			return false;
		}
		if(!$("#idAddr").val() || StringUtils.isEmpty($("#idAddr").val())){
			top.$.ligerDialog.SQalert({content: "请填写详细地址！", SQ_type: "error"});
			return false;
		}

		if(!$("#certValidSDt").val() || StringUtils.isEmpty($("#certValidSDt").val())){
			top.$.ligerDialog.SQalert({content: "请选择证件有效起始日期！", SQ_type: "error"});
			return false;
		}
		if(null == certValidEDt && !$("#certValidEDt").val()){
			top.$.ligerDialog.SQalert({content: "请选择证件有效终止日期！", SQ_type: "error"});
			return false;
		}
		data["indCd"] = liger.get("indCd").selectedValue;
		data["stdIndCd"] = liger.get("stdIndCd").selectedValue;
		data["bkCd"] = liger.get("bkCd").selectedValue;
		data["bkNm"] = liger.get("bkCd").selectedText;
		data["accNo"] =  $("#accNo").val();
		data["mp"] = $("#mp").val();
		data["bkNo"] = $("#bkNo").val();
		data["isSelfEmp"] = liger.get("isSelfEmp").selectedValue;
		data["isSmallBus"] = liger.get("isSmallBus").selectedValue;
		data["certNo"] = $("#certNo").val();
		data["cstNm"] = $("#cstNm").val();
		data["domicileProvince"] = getRgnProvCd();
		data["domicleCity"] = getRgnCityCd();
		data["domicleCounty"] = getRgnCountyCd();
		data["idAddr"] = $("#idAddr").val();
		data["certValidSDt"] = $("#certValidSDt").val();//身份证有效期
		if (null == certValidEDt) {
			data["certValidEDt"] = $("#certValidEDt").val();//身份证截止日期
		} else {
			data["certValidEDt"] = certValidEDt;
		}
	}
	if (null != cstTypCd && "2" == cstTypCd) {
		// 法人
		if(!$("#indCdCorp").val() || StringUtils.isEmpty($("#indCdCorp").val())){
			top.$.ligerDialog.SQalert({content: "请选择所属行业！", SQ_type: "error"});
			return false;
		}
		if(!$("#stdIndCdCorp").val() || StringUtils.isEmpty($("#stdIndCdCorp").val())){
			top.$.ligerDialog.SQalert({content: "请选择子行业！", SQ_type: "error"});
			return false;
		}
		if(!$("#cstNmCorp").val() || StringUtils.isEmpty($("#cstNmCorp").val())){
			top.$.ligerDialog.SQalert({content: "请填写法人代表姓名！", SQ_type: "error"});
			return false;
		}
		if(!$("#certNoCorp").val() || StringUtils.isEmpty($("#certNoCorp").val())){
			top.$.ligerDialog.SQalert({content: "请填写法人代表身份证号！", SQ_type: "error"});
			return false;
		}
		if(!$("#accNoCorp").val() || StringUtils.isEmpty($("#accNoCorp").val())){
			top.$.ligerDialog.SQalert({content: "请填写银行账号！", SQ_type: "error"});
			return false;
		}
		if(!$("#mpCorp").val() || StringUtils.isEmpty($("#mpCorp").val())){
			top.$.ligerDialog.SQalert({content: "请填写法人代表手机号码！", SQ_type: "error"});
			return false;
		}
		if(!$("#bkNoCorp").val() || StringUtils.isEmpty($("#bkNoCorp").val())){
			top.$.ligerDialog.SQalert({content: "请填写联行号！", SQ_type: "error"});
			return false;
		}
		if(!$("#holdSituationCd").val() || StringUtils.isEmpty($("#holdSituationCd").val())){
			top.$.ligerDialog.SQalert({content: "请选择控股情况！", SQ_type: "error"});
			return false;
		}
		if(!$("#borrowerfeature").val() || StringUtils.isEmpty($("#borrowerfeature").val())){
			top.$.ligerDialog.SQalert({content: "请选择借款人特征！", SQ_type: "error"});
			return false;
		}
		if(!getRgnProvCdSecUse() || StringUtils.isEmpty(getRgnProvCdSecUse())){
			top.$.ligerDialog.SQalert({content: "请维护所在-省！", SQ_type: "error"});
			return false;
		}
		if(!getRgnCityCdSecUse() || StringUtils.isEmpty(getRgnCityCdSecUse())){
			top.$.ligerDialog.SQalert({content: "请维护所在-市！", SQ_type: "error"});
			return false;
		}
		if(!$("#idAddrCorp").val() || StringUtils.isEmpty($("#idAddrCorp").val())){
			top.$.ligerDialog.SQalert({content: "请填写详细地址！", SQ_type: "error"});
			return false;
		}

		if(!$("#certValidSDtCorp").val() || StringUtils.isEmpty($("#certValidSDtCorp").val())){
			top.$.ligerDialog.SQalert({content: "请选择证件有效起始日期！", SQ_type: "error"});
			return false;
		}
		if(null == certValidEDtCorp && !$("#certValidEDtCorp").val()){
			top.$.ligerDialog.SQalert({content: "请选择证件有效终止日期！", SQ_type: "error"});
			return false;
		}

		data["indCd"] = liger.get("indCdCorp").selectedValue;
		data["stdIndCd"] = liger.get("stdIndCdCorp").selectedValue;
		data["accNo"] =  $("#accNoCorp").val();
		data["corpMp"] = $("#mpCorp").val();
		data["bkNo"] = $("#bkNoCorp").val();
		data["holdSituationCd"] = liger.get("holdSituationCd").selectedValue;
		data["borrowerfeature"] = liger.get("borrowerfeature").selectedValue;
		data["certNo"] = $("#certNoCorp").val();
		data["cstNm"] = $("#cstNmCorp").val();
		data["domicileProvince"] = getRgnProvCdSecUse();
		data["domicleCity"] = getRgnCityCdSecUse();
		data["domicleCounty"] = getRgnCountyCdSecUse();
		data["idAddr"] = $("#idAddrCorp").val();
		data["certValidSDt"] = $("#certValidSDtCorp").val();//身份证有效期
		if (null == certValidEDtCorp) {
			data["certValidEDt"] = $("#certValidEDtCorp").val();//身份证截止日期
		} else {
			data["certValidEDt"] = certValidEDtCorp;
		}

	}

	data["fundRasInsId"] = $("#fundRasInsId").val();
	data["prjId"] = $("#prjId").val();
	data["cstId"] = $("#cstId").val();
	data["cstAccInfoId"] = $("#cstAccInfoId").val();
	data["cstTypCd"] = $("#cstTypCd").val();
    var url = '<%=path%>/institution/syfl/saveSyflPrjAccInfo.do';
    var wait_dialog;
    console.log(data);
    $.ajax({
        type: 'post',
        dataType: 'json',
        data: data,
        url: url,
        beforeSend: function () {
            wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
        },
        success: function (msg) {
            wait_dialog.close();
            if (msg.success == 1) {
				resetAccResCd(msg.data.accResCd);
				UIUtils.alertSuccessHold1(msg.info);
            } else {
                UIUtils.alertErrorHold1(msg.info);
            }
        }
    });
}

function tlBind(){
    if(!$("#tlCode").val()){
    	top.$.ligerDialog.SQalert({content: "请填写通联支付绑卡验证码！", SQ_type: "error"});
    	return false;
    }
    var ligerForm = liger.get("ins_cfg_info_edit_form");

    var data = ligerForm.getData();
    data["bkCd"] = liger.get("bkCd").selectedValue;
    data["bkNm"] = liger.get("bkCd").selectedText;
    data["accNo"] =  $("#accNo").val();
	data["bkNo"] =  $("#bkNo").val();
    data["mp"] = $("#mp").val();
    data["certNo"] = $("#certNo").val();
    data["prjId"] = $("#prjId").val();
    data["cstId"] = $("#cstId").val();
    data["cstNm"] = $("#cstNm").val();
    data["fundRasInsId"] = $("#fundRasInsId").val();
	data["cstTypCd"] = $("#cstTypCd").val();
    data["phoneCode"] = $("#tlCode").val(); //

    var url = '<%=path%>/institution/syfl/syflBindCard.do';
    var wait_dialog;
    $.ajax({
        type: 'post',
        dataType: 'json',
        data: data,
        url: url,
        beforeSend: function () {
            wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
        },
        success: function (msg) {
            wait_dialog.close();
            if (msg.success == 1) {
                disabledInput2("1");
                UIUtils.alertSuccessHold1(msg.info);
                resetAccResCd(msg.data.accResCd);
            } else {
                UIUtils.alertErrorHold1(msg.info);
            }
        }
    });
}

function payBackCode(){
	if($("#payBackMsmCodeCfg").attr("isSend") == '1'){
		return;
	}
	settime($("#payBackMsmCodeCfg"), 180);
	var ligerForm = liger.get("ins_cfg_info_edit_form");

	var data = ligerForm.getData();

	data["bkCd"] = liger.get("bkCd").selectedValue;
	data["bkNm"] = liger.get("bkCd").selectedText;
	data["accNo"] =  $("#accNo").val();
	data["bkNo"] =  $("#bkNo").val();
	data["mp"] = $("#mp").val();
	data["certNo"] = $("#certNo").val();
	data["prjId"] = $("#prjId").val();
	data["cstId"] = $("#cstId").val();
	data["cstNm"] = $("#cstNm").val();
	data["cstTypCd"] = $("#cstTypCd").val();
	data["fundRasInsId"] = $("#fundRasInsId").val();
	var url = '<%=path%>/institution/syfl/sendVcodeSyflForCorp.do';
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType: 'json',
		data: data,
		url: url,
		beforeSend: function () {
			wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
		},
		success: function (msg) {
			wait_dialog.close();
			if (msg.success == 1) {
				UIUtils.alertSuccessHold1(msg.info);
			} else {
				UIUtils.alertErrorHold1(msg.info);
			}
		}
	});
}

function payBackBind(){
	if(!$("#payBackCode").val()){
		top.$.ligerDialog.SQalert({content: "请输入绑卡验证码！", SQ_type: "error"});
		return false;
	}
	var ligerForm = liger.get("ins_cfg_info_edit_form");

	var data = ligerForm.getData();
	data["bkCd"] = liger.get("bkCd").selectedValue;
	data["bkNm"] = liger.get("bkCd").selectedText;
	data["accNo"] =  $("#accNo").val();
	data["bkNo"] =  $("#bkNo").val();
	data["mp"] = $("#mp").val();
	data["certNo"] = $("#certNo").val();
	data["prjId"] = $("#prjId").val();
	data["cstId"] = $("#cstId").val();
	data["cstNm"] = $("#cstNm").val();
	data["fundRasInsId"] = $("#fundRasInsId").val();
	data["cstTypCd"] = $("#cstTypCd").val();
	data["phoneCode"] = $("#payBackCode").val();

	var url = '<%=path%>/institution/syfl/syflBindCardForCorp.do';
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType: 'json',
		data: data,
		url: url,
		beforeSend: function () {
			wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
		},
		success: function (msg) {
			wait_dialog.close();
			if (msg.success == 1) {
				disabledInput2();
				UIUtils.alertSuccessHold1(msg.info);
				resetAccResCd(msg.data.accResCd);
			} else {
				UIUtils.alertErrorHold1(msg.info);
			}
		}
	});
}

function npCode(){
	if($("#npMsmCodeCfg").attr("isSend") == '1'){
		return;
	}
	settime($("#npMsmCodeCfg"), 180);
	var ligerForm = liger.get("ins_cfg_info_edit_form");

	var data = ligerForm.getData();

	data["bkCd"] = liger.get("bkCd").selectedValue;
	data["bkNm"] = liger.get("bkCd").selectedText;
	data["accNo"] =  $("#accNo").val();
	data["bkNo"] =  $("#bkNo").val();
	data["mp"] = $("#mp").val();
	data["certNo"] = $("#certNo").val();
	data["prjId"] = $("#prjId").val();
	data["cstId"] = $("#cstId").val();
	data["cstNm"] = $("#cstNm").val();
	data["cstTypCd"] = $("#cstTypCd").val();
	data["fundRasInsId"] = $("#fundRasInsId").val();
	var url = '<%=path%>/institution/syfl/sendVcodeSyflForNp.do';
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType: 'json',
		data: data,
		url: url,
		beforeSend: function () {
			wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
		},
		success: function (msg) {
			wait_dialog.close();
			if (msg.success == 1) {
				UIUtils.alertSuccessHold1(msg.info);
			} else {
				UIUtils.alertErrorHold1(msg.info);
			}
		}
	});
}

function npBind(){
	if(!$("#npCode").val()){
		top.$.ligerDialog.SQalert({content: "请填写绑卡验证码！", SQ_type: "error"});
		return false;
	}
	var ligerForm = liger.get("ins_cfg_info_edit_form");

	var data = ligerForm.getData();
	data["bkCd"] = liger.get("bkCd").selectedValue;
	data["bkNm"] = liger.get("bkCd").selectedText;
	data["accNo"] =  $("#accNo").val();
	data["bkNo"] =  $("#bkNo").val();
	data["mp"] = $("#mp").val();
	data["certNo"] = $("#certNo").val();
	data["prjId"] = $("#prjId").val();
	data["cstId"] = $("#cstId").val();
	data["cstNm"] = $("#cstNm").val();
	data["fundRasInsId"] = $("#fundRasInsId").val();
	data["cstTypCd"] = $("#cstTypCd").val();
	data["phoneCode"] = $("#npCode").val(); //

	var url = '<%=path%>/institution/syfl/syflBindCardForNp.do';
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType: 'json',
		data: data,
		url: url,
		beforeSend: function () {
			wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
		},
		success: function (msg) {
			wait_dialog.close();
			if (msg.success == 1) {
				disabledInput2("2");
				UIUtils.alertSuccessHold1(msg.info);
				resetAccResCd(msg.data.accResCd);
			} else {
				UIUtils.alertErrorHold1(msg.info);
			}
		}
	});
}


function settime(obj, countdown) {
	//发送验证码倒计时
	if (countdown == 0) {
		$(obj).removeClass("disabledBtn")
		$(obj).attr("style", "background: ");
		$(obj).attr("isSend", "0");
		$(obj).text("获取验证码");
		countdown = 180;
		return;
	} else {
		$(obj).addClass("disabledBtn")
		$(obj).attr("style", "background: gray;");
		$(obj).attr("isSend", "1");
		$(obj).text("重新发送(" + countdown + ")");
		countdown--;
	}
	setTimeout(function () {
		settime($(obj), countdown)
	}, 1000)
}

//选择长期置灰时间控件
function enduring(checkbox) {
	if (null != cstTypCd && "1" == cstTypCd) {
		// 自然人
		if ($("#checkOne").is(':checked')){
			$("#certValidEDt").hide();
			certValidEDt = "长期";
		} else {
			$("#certValidEDt").show();
			certValidEDt = null;
		}
	}
	if (null != cstTypCd && "2" == cstTypCd) {
		// 法人
		if ($("#checkOneCorp").is(':checked')){
			$("#certValidEDtCorp").hide();
			certValidEDtCorp = "长期";
		} else {
			$("#certValidEDtCorp").show();
			certValidEDtCorp = null;
		}
	}
}

</script>

</body>
</html>